﻿// -----------------------------------------------------------------------------
// Generate By Furion Tools v3.0.6                            
// -----------------------------------------------------------------------------

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using HOPU.OnlineSchool.Core;

namespace HOPU.OnlineSchool.Core
{
    public partial class EduTeacher : IEntity<MasterDbContextLocator>, IEntityTypeBuilder<EduTeacher, MasterDbContextLocator>
    {
    
        public string Id { get; set; }
        public string Name { get; set; }
        public string Intro { get; set; }
        public string Career { get; set; }
        public int Level { get; set; }
        public string Avatar { get; set; }
        public int Sort { get; set; }
        public byte IsDeleted { get; set; }
        public DateTime GmtCreate { get; set; } = DateTime.Now;//为属性设定默认值
        public DateTime GmtModified { get; set; } = DateTime.Now;
    
        public void Configure(EntityTypeBuilder<EduTeacher> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
                entityBuilder.ToTable("edu_teacher");

                entityBuilder.HasComment("讲师");

                entityBuilder.HasIndex(e => e.Name, "uk_name")
                    .IsUnique();

                entityBuilder.Property(e => e.Id)
                    .HasMaxLength(19)
                    .HasColumnName("id")
                    .IsFixedLength(true)
                    .HasComment("讲师ID");

                entityBuilder.Property(e => e.Avatar)
                    .HasMaxLength(255)
                    .HasColumnName("avatar")
                    .HasComment("讲师头像");

                entityBuilder.Property(e => e.Career)
                    .HasMaxLength(500)
                    .HasColumnName("career")
                    .HasComment("讲师资历,一句话说明讲师");

                entityBuilder.Property(e => e.GmtCreate)
                    .HasColumnName("gmt_create")
                    .HasComment("创建时间");

                entityBuilder.Property(e => e.GmtModified)
                    .HasColumnName("gmt_modified")
                    .HasComment("更新时间");

                entityBuilder.Property(e => e.Intro)
                    .IsRequired()
                    .HasMaxLength(500)
                    .HasColumnName("intro")
                    .HasDefaultValueSql("''")
                    .HasComment("讲师简介");

                entityBuilder.Property(e => e.IsDeleted)
                    .HasColumnName("is_deleted")
                    .HasComment("逻辑删除 1（true）已删除， 0（false）未删除");

                entityBuilder.Property(e => e.Level)
                    .HasColumnType("int unsigned")
                    .HasColumnName("level")
                    .HasComment("头衔 1高级讲师 2首席讲师");

                entityBuilder.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(20)
                    .HasColumnName("name")
                    .HasComment("讲师姓名");

                entityBuilder.Property(e => e.Sort)
                    .HasColumnType("int unsigned")
                    .HasColumnName("sort")
                    .HasComment("排序");
        }

    }
}
